package com.eques.database.base

import android.content.Context
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import com.eques.database.DevList
import com.eques.database.ShaowData
import com.eques.database.dao.DevListDao
import com.eques.database.dao.ShaowDao

@Database(
    entities = [DevList::class,ShaowData::class],
    version = 1,
    exportSchema = true  // 启用迁移记录
)
abstract class AppDatabase : RoomDatabase() {
    abstract fun ykDao(): DevListDao
    abstract fun shaowDao(): ShaowDao

    companion object {
        fun build(context: Context) = Room.databaseBuilder(
            context,
            AppDatabase::class.java,
            "eques_db"
        ).build()
    }
}